package azku.entitys;

import org.json.JSONException;
import org.json.JSONObject;

public class EGroupType {
	public final static String KEY_TypeID = "typeid";
	public final static String KEY_TypeName = "typename";
	public final static String KEY_IDesc = "idesc";
	public final static String KEY_IType = "itype";
	public final static String KEY_IViewPower = "iviewpower";

	public final static int VALUE_NAVLIST = 1;
	public final static int VALUE_USERNAV = 2;

	private int mTypeID;
	private String mTypeName;
	private int mIDesc;
	private int mIType;
	private int mIViewPower;

	public EGroupType() {
		this.mTypeID = 0;
		this.mTypeName = "";
	}

	public void setTypeID(int id) {
		this.mTypeID = id;
	}

	public int getTypeID() {
		return this.mTypeID;
	}

	public void setTypeName(String typename) {
		this.mTypeName = typename;
	}

	public String getTypeName() {
		return this.mTypeName;
	}

	public int getIDesc() {
		return this.mIDesc;
	}

	public void setIDesc(int idesc) {
		this.mIDesc = idesc;
	}

	public int getIType() {
		return this.mIType;
	}

	public void setIType(int itype) {
		this.mIType = itype;
	}

	public int getIViewPower() {
		return this.mIViewPower;
	}

	public void setIViewPower(int iviewpower) {
		this.mIViewPower = iviewpower;
	}

	public void bindParams(JSONObject jsonObj) {
		if (jsonObj != null) {
			try {
				this.setTypeID(jsonObj.getInt(KEY_TypeID));
				this.setTypeName(jsonObj.getString(KEY_TypeName));
				this.setIDesc(jsonObj.getInt(KEY_IDesc));
				this.setIType(jsonObj.getInt(KEY_IType));
				this.setIViewPower(jsonObj.getInt(KEY_IViewPower));
			} catch (JSONException e) {
				e.printStackTrace();
			}
		}
	}
}
